<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="com.cap.bts.framework.usermgnt.constant.EmployeeStatus"%>    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>会员卡库存信息</title>
<%@include file="../include/include.jsp"%>
<link rel="stylesheet" type="text/css" href="${csspath }/public.css"/>
<link rel="stylesheet" type="text/css" href="${csspath }/datepicker.css"/>
<link rel="stylesheet" type="text/css" href="${csspath }/style_l.css"/>
<script type="text/javascript" src="${jspath }/jquery-1.4.4.js"></script>
<script type="text/javascript" src="${jspath }/jquery.ui.min.js"></script>
<script type="text/javascript" src="${jspath }/ui.datepicker_zh-CN.js"></script>
<script type="text/javascript" src="${jspath }/jquery.blockUI.js"></script>
<script type="text/javascript" src="${jspath }/public.js"></script>
<script type="text/javascript" src="${jspath }/jquery.selectAll.js"></script>
<script type="text/javascript" src="${jspath}/jquery/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="${jspath}/jquery/jquery.alerts.js"></script>
<script type="text/javascript" src="${jspath}/load_layer.js"></script>
<link rel="stylesheet" type="text/css" href="${csspath}/jquery.alerts.css" />

<link rel="stylesheet" type="text/css"
	href="${webcontext}/css/validationEngine.jquery.css" />
<script src="${jspath}/jquery/validate/jquery.validationEngine.js"
	type="text/javascript"></script>
<script src="${jspath}/jquery/validate/jquery.validationEngine-zh.js"
	type="text/javascript"></script>
	<script type="text/javascript"
	src="${webcontext}/javascript/jquery/jquery.ui.draggable.js"></script>
<link rel="stylesheet" type="text/css"
	href="${bootstrapPath}/css/bootstrap.css" />
<script type="text/javascript" src="${bootstrapPath}/js/bootstrap.js"></script>
<style type="text/css">
.formError .formErrorContent {
    -moz-border-radius: 6px 6px 6px 6px;
    -moz-box-shadow: 0 0 6px #000000;
    background: none repeat scroll 0 0 #EE0101;
    border: 2px solid #DDDDDD;
    color: #FFFFFF;
    font-family: tahoma;
    font-size: 11px;
    padding: 4px 10px;
    width: 100px;
}
a {
display:block;
width:100px;
height:40px;
border:1px solid #CCC;
background:#FFF;
}
</style>

<script type="text/javascript">
var myHeight = 0;
$(function(){
	
	$("#search_form").validationEngine(
			{
             promptPosition:"topLeft",
             success:false,
             validationEventTriggers:"blur",
             scroll : false,
			 failure:function(){} 
	});

});
  
function search(){
	info_form.action="${webcontext}/crmdp/dealer/report/toQueryInventoryPage";
	document.getElementById("info_form").submit();
}
function chart(){
	info_form.action="${webcontext}/crmdp/dealer/report/toChartInventoryPage";
	document.getElementById("info_form").submit();
}
/* function startChange(startMonth){
	var today = new Date();   
	var month = today.getMonth() + 1;
	if(-parseInt(startMonth)>month){
		$("#startMonth").get(0).options[month-1].selected = true;
	}
}
function endChange(endMonth){
	var today = new Date();   
	var month = today.getMonth() + 1;
	if(-parseInt(endMonth)>month){
		$("#endMonth").get(0).options[month-1].selected = true;
	}
} */
</script> 
</head>
<body>
	<!-- content -->
	<div>
		<!-- wrap -->
		<div id="wrap" style="width:75%;margin-top: 10px;">
			<!-- info_div -->
	<form:form id="info_form"  class="form-horizontal" method="post" modelAttribute="dto">
				<input type="hidden" name="dealerId" value="${param.dealerId}">
		<div class="row" style="margin-left: auto;margin-right: auto;">
				<%-- <div class="form-group" style="text-align: center;">
					<label class="col-sm-2 control-label" for="transactionStartDate">起始日期</label>
					<div class="col-sm-3">
						<input name="transactionStartDate" class="form-control input-sm validate[length[0,100]] date" id="startDate" type="text"
							 value="${dto.transactionStartDate}" />
					</div>
					<label for="transactionEndDate" class="col-sm-2 control-label">结束日期</label>
					<div class="col-sm-3">
					 	<input  name="transactionEndDate" class="form-control input-sm validate[length[0,100]] date" id="endDate" type="text" 
						 value="${dto.transactionEndDate}" />
					</div>
				</div> --%>
				<div class="form-group" style="text-align: center;">
				    <core:if test="${sessionScope.FROM_MARS_FLAG}">
					<label for="hierarchy" class="col-sm-2 control-label">查看门店</label>
					<div class="col-sm-3">
				       	<form:select path="hierarchy" cssClass="form-control" id="hierarchy" style="width:150px">
				       	<form:option value="1">所有门店</form:option>
						    <core:forEach items="${dealerList}" var="dealerList">
					           <form:option value="${dealerList}">${dealerList}</form:option>
      						</core:forEach>
						</form:select>
					</div>
                    </core:if>
				</div>
			</div>
				       	<div style="text-align: center; margin-top: 10px;">
							<button type="button" class="btn" value="查询 " onclick="search()"><i class="glyphicon glyphicon-search" style="color:#FFFFFF"></i>&nbsp;查询</button>
							<button type="reset" class="btn" value="重置 "><i class="glyphicon glyphicon-trash" style="color:#FFFFFF"></i>&nbsp;重置 </button>
							<button type="button" class="btn" value="图表 " onclick="chart()"><i class="glyphicon glyphicon-stats" style="color:#FFFFFF"></i>&nbsp;图表</button>
						</div>
				<div class="spliter h_10"></div>
			<!-- /search_div -->
			<div class="spliter h_5"></div>
			<div class="page_info"></div>
			<div class="spliter h_10"></div>
			<!-- data_div -->
			<div id="dataTable" class="data_div">
			<table id="table" class="table">
				<tr>
					<th width="18%">会员卡种类</th>
					<!-- <th width="10%">订购数量</th>
					<th width="10%">销售数量</th>
					<th width="10%">月均销售数量</th> -->
					<th width="10%">当前库存</th>
					<th width="12%">在途数量</th>
					<th width="10%">安全库存建议</th>
				</tr>
            	<core:forEach items="${resultList}" var="dto">
					<tr>
                        <td class="align_l">${dto.cardName}</td>
                        <%-- <td class="text-right">${dto.orderAmount}</td>
                        <td class="text-right">${dto.sellAmount}</td>
                        <td class="text-right">${dto.monthlyAvg}</td> --%>
                        <td class="text-right">${dto.inventoryAmount}</td>
                        <td class="text-right">${dto.notReceivedAmount}</td>
                        <td class="text-right">${dto.suggestAmount}</td>
                    </tr>
                 </core:forEach>
                 <tr>
                        <td class="align_l">合计</td>
                        <%-- <td class="text-right">${summary.orderAmount}</td>
                        <td class="text-right">${summary.sellAmount}</td>
                        <td class="text-right">${summary.monthlyAvg}</td> --%>
                        <td class="text-right">${summary.inventoryAmount}</td>
                        <td class="text-right">${summary.notReceivedAmount}</td>
                        <td class="text-right">${summary.suggestAmount}</td>
                    </tr>
			</table>
		</div>
			<!-- /data_div -->
	</form:form>
		</div>
		<!-- /wrap -->
		</div>
	<!-- /content -->
  </body>
</html>